
/* 
 * ----------------------
 * Includes
 * ----------------------
 */
 
 // Standard
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>

// SDL
#include <SDL.h>
#include <SDL/SDL_ttf.h>

// GUI
#include "elder_gui.h"

// Context
#include "context.h"

/* 
 * ----------------------
 * Global variables
 * ----------------------
 */

context currentContext;

/* 
 * ----------------------
 * Functions
 * ----------------------
 */
 
 void initContext(void)
 {
 	// Get the time
 	time_t rawtime;
 	struct tm *timeinfo;
	
	time(&rawtime);
	timeinfo = localtime (&rawtime);

  	strftime(currentContext.logPath,LOG_PATH_LENGTH,"/home/logs/%d-%m_%H-%M-%S",timeinfo);
 	
 	currentContext.run			= 0;
 	currentContext.log 			= 1;
 	currentContext.volume 		= 50;
 	currentContext.score 		= 0;
 	currentContext.timeLeft 	= 90;
 	
 	// Batteries
 	currentContext.batteries.el1Voltage = 1400;
 	
 	currentContext.batteries.el2Voltage = 1400;
 	
 }